# 1:打开文件
# 相对路径，mode="r",代表只读，如果文件存在则读取文件内容，如果文件不存在则抛出异常
# f = open("../第二章/test1.txt", mode="r", encoding="utf-8")
# f = open("test2.txt", mode="r", encoding="utf-8")
# 绝对路径
import os
path = os.getcwd()
print(path)
file_name = path + "/test2.txt"
f = open(file_name, mode="r", encoding="utf-8")


